$def with (q, results, search_time, page=1, results_per_page=20)

$var title: Search Open Library for $q

<div id="contentHead">
    <h1>$_("Search Inside")</h1>
</div>

<div id="contentBody">

  <form class="siteSearch searchInsideForm" action="/search/inside">
    <input type="text" class="larger" name="q" value="$q"/>
    <input type="submit" class="generic-button" value="$_('Search')">
  </form>
    $ num_found = 0
    $if q:
        $if results and 'error' not in results and results['hits']:
            $ hits = results['hits'].get('hits', [])
            $ num_found = results['hits'].get('total', 0)

        $if 'error' in results:
            <div class="searchResultsError">$results['error']</div>

        $if not num_found:
            $def escaped_query(): <strong>$q</strong>
            <p class="sansserif red collapse">$_('No hits for: %(query)s', query=escaped_query()) </p>

        $else:
            <p class="search-results-stats">$ungettext('About 1 result found in %(seconds)s', 'About %(count)s results found in %(seconds)s', num_found, count=commify(num_found), seconds="%.2f" % search_time)</p>

        $:macros.FulltextResults(q, results, page=page)
</div>

